<!-- 下发任务页面 -->

<div class="container" :important="sendTask">
    <style>
        .taskjd{
            border: 1px solid #ccc;
            padding: 15px;
            border-radius: 5px;
            position: relative;
            min-height: 100px;
        }

        .taskjd button{
            position: absolute;
            right: 5px;
            bottom: 5px;
        }

        .jds{
            padding:0 20px;
        }
    </style>

    <div class="row handler">

        <!-- 任务下发 -->
        <div role="tabpanel" class="tab-pane">

            <span><i style="font-size: 15px" class="iconfont">&#xe601;</i>填写任务信息</span>
            <hr>

            <div id="sendTask" class="form-horizontal" data-parsley-validate="" novalidate="">
                <div class="form-group">
                    <label for="taskname" class="col-sm-2 control-label">任务名称</label>
                    <div class="col-sm-10">
                        <input type="text" :duplex="@send.name" class="form-control" id="taskName" placeholder="请输入任务名称，50字以内" required>
                        <p>还能写{{50 - @send.name.length}}字</p>
                    </div>
                </div>

                <div class="form-group">
                    <label for="taskcontent" class="col-sm-2 control-label">任务内容</label>
                    <div class="col-sm-10">
                        <textarea class="form-control" :duplex="@send.des" id="taskContent" placeholder="请输入任务内容，1000字以内" required></textarea>
                        <p if="!@contentOverflow">还能写{{1000 - @send.des.length}}字</p>
                    </div>
                </div>

                <div class="form-group">
                    <label for="taskcontent" class="col-sm-2 control-label">选择附件</label>
                    <input id="lefile" type="file" style="display:none" ms-on-change="@fileSe">
                    <div class="col-sm-4">
                        <button onclick="$('input[id=lefile]').click();" class="btn btn-success">选择文件</button>
                        <p id="fileName"></p>
                        <p id="fileError" style="color: red"></p>
                    </div>
                </div>

                <div class="form-group">
                    <label for="taskcontent" class="col-sm-2 control-label">开始时间</label>
                    <div class="col-sm-4">
                        <div class="input-group date" data-provide="datepicker">
                            <input type="text" class="form-control" :duplex="@send.startTime">
                            <div class="input-group-addon">
                                <span class="glyphicon glyphicon-th"></span>
                            </div>
                        </div>
                    </div>

                    <label for="taskcontent" class="col-sm-2 control-label">结束时间</label>
                    <div class="col-sm-4">
                        <div class="input-group date" data-provide="datepicker">
                            <input type="text" class="form-control" :duplex="@send.endTime">
                            <div class="input-group-addon">
                                <span class="glyphicon glyphicon-th"></span>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="form-group">
                    <label for="selectGroup" class="col-sm-2 control-label">选择支队</label>
                    <div class="col-sm-10">
                        <select id="selectGroup" class="form-control">
                            <option disabled selected value="">--请选择--</option>
                            <option :for="el in @send.teamLIst" :attr="{value : el.groupId}">{{el.groupName}}</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="selectGroup" class="col-sm-2 control-label">选择任务类型</label>
                    <div class="col-sm-10">
                        <select id="selectType" class="form-control">
                            <option disabled selected value="">--请选择--</option>
                            <option :for="el in @send.taskType" :attr="{value : el.taskTypeId}">{{el.taskTypeName}}</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="selectGroup" class="col-sm-2 control-label">选择权重</label>
                    <div class="col-sm-10">
                        <select id="selectWeight" class="form-control">
                            <option disabled selected value="">--请选择--</option>
                            <option value="1">1</option>
                            <option value="2">2</option>
                            <option value="3">3</option>
                            <option value="4">4</option>
                            <option value="5">5</option>
                        </select>
                    </div>
                </div>

                <div class="form-group">
                    <label for="taskcontent" class="col-sm-2 control-label">任务阶段</label>
                    <div class="col-sm-10">
                        <div class="taskjd" id="taskjd">
                            <ul id="jdBtn">
                                <li :for="($index, el) in @send.taskStageDTOS" :attr="{id : 'jd-' + $index}">
                                    <span class="jds" >任务阶段名：{{el.tsName}}</span><span class="jds">占比：{{el.tsCompletion}}</span><span class="jds">内容：{{el.tsDES}}</span>
                                    <span :click="@rmJd($index)" style="color: red;cursor: pointer">X</span></li>
                            </ul>
                        </div>
                    </div>
                </div>


                <div class="form-group">
                    <label for="selectGroup" class="col-sm-2 control-label"></label>
                    <div class="col-sm-10">
                        <button class="btn btn-primary" data-toggle="modal" data-target="#addTaskjd">添加任务阶段</button>
                    </div>
                </div>

                <div class="form-group">
                    <label for="selectGroup" class="col-sm-2 control-label"></label>
                    <div class="col-sm-10">
                        <button class="btn btn-primary" :click="@sendTask">提交</button>
                    </div>
                </div>
            </div>
        </div>

    </div>

    <!-- task jd modal -->
    <div class="modal fade" id="addTaskjd" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h5 class="modal-title" id="exampleModalLabel"><i style="font-size: 15px;margin: 0 10px;" class="iconfont">&#xe64c;</i>添加任务阶段</h5>
                </div>
                <div class="modal-body">
                    <div>
                        <div class="row form-group">
                            <label for="recipient-name" class="col-sm-2 col-sm-offset-1">阶段名称:</label>
                            <input type="text" class="col-sm-8" id="recipient-name" :duplex="@jd.name">
                            <span class="col-sm-1 tip">*</span>
                        </div>
                        <div class="row form-group">
                            <label for="message-text" class="col-sm-2 col-sm-offset-1">阶段占比:</label>
                            <input class="col-sm-8" type="number" min="0" max="100" id="message-text" :duplex="@jd.per">
                            <span class="col-sm-1 tip">*</span>
                        </div>
                        <div class="row form-group">
                            <label for="message-text" class="col-sm-2 col-sm-offset-1">阶段内容:</label>
                            <textarea class="col-sm-8" style="resize: none;height: 100px;min-height: 100px" :duplex="@jd.content"></textarea>
                            <span class="col-sm-1 tip">*</span>
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" :click="@addTaskJd">提交</button>
                </div>
            </div>
        </div>
    </div>


</div>



<!-- jd modal -->
<div class="modal fade" id="addTaskLoding" tabindex="-1" role="dialog" aria-labelledby="lodaingModal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">

            <div class="modal-body">
                任务下发中...
            </div>

        </div>
    </div>
</div>